package org.seckill.dto;

/**
 *
 */
// 泛型类型
// 所有的ajax请求返回类型，封装json结果
public class SeckillResult<T> {

    // 判断是否成功
    private boolean success;

    // 泛型类型的数据
    private T data;

    private String error;

    //  如果success = true，他是有数据的
    public SeckillResult(boolean success, T data) {
        this.success = success;
        this.data = data;
    }

    // 如果success = false，要返回错误信息
    public SeckillResult(boolean success, String error) {
        this.success = success;
        this.error = error;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }
}
